﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data.OleDb;

namespace FOBTV.Web.DBUtility
{
	/// <summary>
	/// 为类属性附加属性的Attribute类
	/// </summary>
	[AttributeUsage(AttributeTargets.Property)]
	public sealed class PropertyAttribute : Attribute
	{
		private string _columnname = "ColumnName";
		private OleDbType _dbtype = OleDbType.Variant;
		private bool _isPrimaryKey = false;
		private bool _isIdentity = false;
		public PropertyAttribute(string ColumnName, OleDbType DbType, bool IsPrimaryKey, bool IsIdentity)
		{
			this._columnname = ColumnName;
			this._dbtype = DbType;
			this._isPrimaryKey = IsPrimaryKey;
			this._isIdentity = IsIdentity;
		}

		public string ColumnName
		{
			get
			{
				return this._columnname;
			}
			set
			{
				this._columnname = value;
			}
		}

		public OleDbType DbType
		{
			get
			{
				return this._dbtype;
			}
			set
			{
				this._dbtype = value;
			}
		}

		public bool IsPrimaryKey
		{
			get
			{
				return this._isPrimaryKey;
			}
			set
			{
				this._isPrimaryKey = value;
			}
		}

		public bool IsIdentity
		{
			get
			{
				return this._isIdentity;
			}
			set
			{
				this._isIdentity = value;
			}
		}
	}
}